Notes for the Debian OpenCV packages:

 To compile code against OpenCV, use `pkg-config --cflags opencv`:

   gcc `pkg-config --cflags opencv` -c code.c -o code.o

 To link it afterwards, use `pkg-config --libs opencv`:

   gcc code.o -o code `pkg-config --libs opencv` -lotherlibs

There is currently no way to exclude libcvhighgui-dev and other from the
link process. I reported with upstream about this [0].

[0]: https://code.ros.org/trac/opencv/ticket/332

